package cn.icanci.test.service.impl;

import cn.icanci.test.service.HelloService;

import org.springframework.stereotype.Service;

/**
 * @author icanci
 * @date Created in 2021/03/02 23:51
 * @version 1.0
 */
@Service
public class HelloServiceImpl implements HelloService {
    @Override
    public void sayHello() {
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("HelloServiceImpl.sayHello");
        need();
    }

    @Override
    public void justWantToThrowException() {
        System.out.println("HelloServiceImpl.justWantToThrowException");
        throw new RuntimeException("justWantToThrowException");
    }

    private void need() {
        System.out.println("HelloServiceImpl.need");
    }
}
